#ifndef __MBM_MEMORY_ADAPTER_H__
#define __MBM_MEMORY_ADAPTER_H__


#ifdef __cplusplus
extern "C"
{
#endif


void *mbm_malloc_ext_mem(Int32 size, ImpCStr file, UInt32 line);
void mbm_free_ext_mem(void **p);

void *mbm_malloc_int_mem(Int32 size);
void mbm_free_int_mem(void **p);

UInt32 mbm_ext_mem_left_size(void);
UInt32 mbm_int_mem_left_size(void);

Int32 mbm_vsscanf(ImpCStr str, ImpCStr fmt, va_list params);


#ifdef __cplusplus
}
#endif


#ifdef WIN32
#define MBM_Malloc(size)    mbm_malloc_ext_mem((size), __FILE__, __LINE__)
#else
#define MBM_Malloc(size)    mbm_malloc_ext_mem((size), __MODULE__, __LINE__)
#endif
#define MBM_Free(ptr)       mbm_free_ext_mem(&(ptr))


#endif/* __MBM_MEMORY_ADAPTER_H__  */
